<template>
	<view class="container">
		<view class="title-block">
			<text>全部收支</text>
		</view>
		<view class="list" v-for="item in moneyList">
			<van-cell size="large" :title="item.memo" :value="item.money" />
		</view>
	</view>
</template>

<script setup>
	import {
		ref
	} from 'vue';
	import {
		onLoad
	} from '@dcloudio/uni-app';
	import {
		moneylog
	} from '@/api/index.js'
	let moneyList = ref(null)
	let currentPage = ref(0)
	let lastPage = ref(0)
	let page = ref(1)
	onLoad(() => {
		moneylog({
			page: page.value
		}).then(res => {
			moneyList.value = res.data.data
			currentPage.value = res.data.current_page
			lastPage.value = res.data.last_page
		})
	})
</script>

<style scoped>
	.container {
		background-color: #f5f5f5;
		min-height: 100vh;
	}

	.title-block {
		padding-left: 40rpx;
		padding-right: 40rpx;
		display: flex;
		justify-content: space-between;
		align-items: center;
		font-size: 30rpx;
		font-weight: bold;
		color: #3c91ff;
		height: 80rpx;
	}

	.list {
		background-color: #fff;
	}
</style>